import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber, IsString } from 'class-validator';

export class CreateOrderDto {
  @ApiProperty({ description: '用户ID', example: 1 })
  @IsNumber()
  @IsNotEmpty({ message: '用户ID不能为空' })
  userId: number;

  @ApiProperty({ description: '房间ID', example: 1 })
  @IsNumber()
  @IsNotEmpty({ message: '房间ID不能为空' })
  roomID: number;

  @ApiProperty({
    description: '入住日期',
    example: '2023-09-10T00:00:00.000Z',
  })
  @IsString({ message: '请输入有效的入住日期' })
  @IsNotEmpty({ message: '入住日期不能为空' })
  checkInDate: string;

  @ApiProperty({
    description: '离店日期',
    example: '2023-09-15T00:00:00.000Z',
  })
  @IsString({ message: '请输入有效的离店日期' })
  @IsNotEmpty({ message: '离店日期不能为空' })
  checkOutDate: string;
}
